package com.bigfish.common.utils;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;

public class CommonUtil {
	public static String getString(InputStream is,String encode){
		try (
				BufferedReader br=new BufferedReader(new InputStreamReader(is, encode));
			){
			StringBuffer sb=new StringBuffer();
			String content=null;
			while((content=br.readLine())!=null){
				sb.append(content+"\r\n");
			}
			return sb.toString();
		} catch (Exception e) {
			e.printStackTrace();
			return "";
		}
	}
	public static boolean objectIsNull(Object obj){
		if(obj==null) return true;
		if("".equals(obj)) return true;
		return false;
	}
}
